package com.runfast.waimai.dao.mapper;

import com.runfast.common.dao.IMapper;
import com.runfast.waimai.dao.model.RunfastGoodsSellRecord;
import com.runfast.waimai.dao.model.RunfastGoodsSellRecordExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface RunfastGoodsSellRecordMapper extends IMapper<RunfastGoodsSellRecord, Integer, RunfastGoodsSellRecordExample> {
    List<RunfastGoodsSellRecord> selectJieDanAndPeiSongByMap(Map<Object,Object> map);
    Integer countJieDanOrPeiSongOrTotalByMap(Map<Object,Object> map);
    List<RunfastGoodsSellRecord> selectByMapWithPageable(Map<Object,Object> map);
    Integer countByMap(Map<Object,Object> map);
    List<RunfastGoodsSellRecord> selectByMapDiaoDu(Map<Object,Object> map);
    Integer countByMapDiaoDu(Map<Object,Object> map);
    Map<Object,Object> cityData(Map<Object,Object> map);



    /*以下为孟祥的*/
    List<Map<String,String>> findByAgentnameAndbusinessnameAndTime(@Param("agentid") List agentid, @Param("name") String name, @Param("date1") Date date1, @Param("date2") Date date2, @Param("isdeliver") Integer isdeliver, @Param("page")Integer page, @Param("pagesize")Integer pagesize);
    Integer findByAgentnameAndbusinessnameAndTimecount(@Param("agentid") List agentid, @Param("name") String name, @Param("date1") Date date1, @Param("date2") Date date2, @Param("isdeliver") Integer isdeliver,@Param("page")Integer page,@Param("pagesize")Integer pagesize);
    List<Map<String,String>> findAgentnameMoney(@Param("agentId") List agentId,@Param("createtime1") Date createtime1,@Param("createtime2") Date createatime2, @Param("isdeliver") Integer isdeliver,@Param("page")Integer page,@Param("pages")Integer pages);

    List<Map<String,BigDecimal>> findshopperAndCityAndtime(@Param("cityname") String cityname, @Param("shoppername") String shoppername, @Param("ceateatime1") Date ceateatime1, @Param("ceateatime2") Date ceateatime2, @Param("page")Integer page, @Param("pagesize")Integer pagesize, @Param("agentid")List agentid);

    List<RunfastGoodsSellRecord> findaftertime(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);

    List<RunfastGoodsSellRecord> finderrorOver(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);
    List<RunfastGoodsSellRecord> findlastscore(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);


    Integer findAgentnameMoneycount(@Param("agentId")List agentId,@Param("createtime1") Date createtime1,@Param("createtime2") Date createatime2, @Param("isdeliver") Integer isdeliver,@Param("page")Integer page,@Param("pages")Integer pages);

    Integer findshopperAndCityAndtimecount(@Param("cityname") String cityname, @Param("shoppername")String shoppername, @Param("ceateatime1")Date ceateatime1, @Param("ceateatime2")Date ceateatime2, @Param("page")Integer page, @Param("pagesize")Integer pagesize, @Param("agentid")List agentid);

    List<RunfastGoodsSellRecord> findBybussinessWithdraw(Integer userid);

    public List<Map<String,Object>> selectSalesCountExport(Map<String, Object> map);
    public List<Map<String,Object>> businessSalesCount(Map<String, Object> map);
    public Integer countByBusinessSalesCount(RunfastGoodsSellRecordExample example);


}